# -*- coding:utf-8 -*-
from django.db import models
from django_thumbs.db.models import ImageWithThumbsField
from django.conf import settings
from pip.cmdoptions import editable 
from multiselectfield import MultiSelectField

COLOR = (
             (1, 'red'),
             (2, 'yellow'),
             (3, 'green'),
             )


class Equipments(models.Model):
    title = models.CharField(max_length=100, verbose_name=u'标题')
    colors = MultiSelectField(choices=COLOR, blank=True, max_length=255)
    price = models.FloatField()
    avatar_url = ImageWithThumbsField(upload_to=settings.EQUIPMENTS_AVATAR, 
                                      default=settings.EQUIPMENTS_AVATAR_DEFAULT,
                                      verbose_name=u'图片')
    def __unicode__(self):
        return self.title